<?php 

class error {
	private $errormsg = array(); 
	private $errornumber = false;
	
	public function e404(){
		header("HTTP/1.0 404 Not Found");
    header("Status: 404 Not Found");
		$_SERVER['REDIRECT_STATUS'] = 404;
		$this->errornumber = 404;
	}

	public function e403(){
		header("HTTP/1.0 403 Forbidden");
    header("Status: 403 Forbidden");
		$_SERVER['REDIRECT_STATUS'] = 403;
		$this->errornumber = 403;
	}
	
	public function add($msg) {
		$this->errormsg[] = $msg;
	}
	
	public function show(){
		global $page;
		
		if($page)
			$page->template->assign('error', implode("\n", $this->errormsg));
		
		if($this->errornumber){
			$page->html->clearLinks();
			$page->html->clearJs();
			$page->html->cache = false;
			$page->html->name = 'err';
			$page->html->link(array('unsupported_browser'));
		
			$page->page_title = "Error &raquo; {$this->errornumber} &laquo;";
					
			return $this->errornumber;		
		}
	}
	
}

?>